<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../header.jsp"%>
<!--  显示内容 -->

<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" style="font-family: '微软雅黑';">
	<!-- Content Header (Page header) -->
	<section class="content-header">
		<h1>
			${module } <small>Control panel</small>
		</h1>
		<ol class="breadcrumb">
			<li><a href="${ctx }"><i class="fa fa-dashboard"></i>主页</a></li>
			<li class="active">基础数据</li>
		</ol>
	</section>

	<!-- Main content -->
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
					<div class="box-header">

					</div>
					<!-- /.box-header -->
					<div class="box-body">
						<table id="table_list" class="table table-bordered table-hover"
							style="font-size: 12px;">
							
							<thead>
		                      <tr>
		                      	<th colspan="3">
		                      		&nbsp;
		                      	</th>
		                      	<th>
		                      		<button class="btn btn-block btn-success" style="width: 100px;" id="query_button">保存</button>
		                      	</th>
		                      </tr>
		                    </thead>
							
							
							<tbody id="list_tbody">
								<!--  使用ajax加载了内容 2015年6月23日10:26:33 -->
							</tbody>

						</table>
					</div>
					<!-- /.box-body -->


				</div>
				<!-- /.box -->

			</div>
			<!-- /.col -->
		</div>
		<!-- /.row -->
		
		<!--  显示下面的分页控件  -->
		<!-- 显示 增加的div -->
	</section>
	<!-- /.content -->
</div>

<jsp:include page="../js.jsp"/>

<!-- page script -->
<script type="text/javascript">
	
	// 在页面加载的时候  
	$(document).ready(function() {
		$.post('${ctx}configuration/list/all',{},function(data){
			var result = jQuery.parseJSON(data);
			var list = result.DATA;
			var size = list.length;
			var context_html = '';
			var prev_html = '';
			var next_html = '';
			$(list).each(function(i) {
				// $(this)
				var index = i+1;
				if(index%2==0){
					next_html += '<td><h4>'+this.descption+'</h4></td><td><input type="text" class="form-control" style="width: 150px;" value='+this.configvalue+' /></td></tr>';
				}else{
					prev_html += '<tr><td><h4>'+this.descption+'</h4></td><td><input type="text" class="form-control" style="width: 150px;" value='+this.configvalue+' /></td>';
				}
			});
			context_html = prev_html + next_html;
			
			$("#list_tbody").html(context_html);
		});
	});
</script>

	<%@ include file="../footer.jsp"%>
	</body>
</html>